import React from "react";
// import Home from "../components/Home.js";
// import About from "../components/About.js";
// import Com1 from "../components/Com1.js";
// import NotFoundPage from "../components/NotFoundPage.js";
import { Redirect } from "react-router-dom";

const Home = React.lazy(() => import("../components/Home.js"));
const About = React.lazy(() => import("../components/About.js"));
const Com1 = React.lazy(() => import("../components/Com1.js"));
const NotFoundPage = React.lazy(() => import("../components/Home.js"));

const routes = [
  {
    path: "/home",
    component: Home,
    routes: [
      {
        path: "/home",
        exact: true,
        render: () => <Redirect to="/home/com1"></Redirect>,
      },
      {
        path: "/home/com1",
        component: Com1,
      },
    ],
  },
  {
    path: "/about",
    component: About,
  },
  {
    path: "*",
    component: NotFoundPage,
  },
];

export default routes;
